package com.appspot.niehonglei.jdo;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.appspot.niehonglei.common.Tools;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Common implements Serializable{

	/**
	 * 首页推荐和友情链接,类型自定
	 */
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private String title;
	
	@Persistent
	private String link;

	@Persistent
	private Date createDate;

	@Persistent
	private Date changeDate;
	
	@Persistent
	private Long type;//0首页推荐 1友情链接

	public Common(String title, String link, Long type) {
		this.createDate = Tools.shiftDate(new Date());
		this.changeDate = Tools.shiftDate(new Date());
		this.title = title;
		this.type = type;
		this.link = link;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getChangeDate() {
		return changeDate;
	}

	public void setChangeDate(Date changeDate) {
		this.changeDate = changeDate;
	}

	public Long getType() {
		return type;
	}

	public void setType(Long type) {
		this.type = type;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
}
